/**
 * 自定义封装的ajax get同步请求
 * @param type
 * @param url
 * @param arg
 * @returns {string}
 */
let getData = function (url,arg) {
    let obj = "";
    $.ajax({
        type:"GET",
        async:false,
        url:url+arg,
        success:function (response) {
            obj = response;
        },
        error: function (data) {
            console.info("error: " + data.responseText);
        }
    });
    return obj;
};

/**
 * 自定义 ajax post请求
 * @param url
 * @param data
 * @returns {string}
 */
let postData = function (url,data) {
    let obj = "";
    $.ajax({
        type:"POST",
        async:false,
        url:url,
        data:data,
        success:function (response) {
            obj = response;
        },
        error: function (data) {
            console.info("error: " + data.responseText);
        }
    });
    return obj;
};


/**
 * 自定义封装的ajax put请求
 * @param url
 * @param arg
 * @returns {string}
 */
let putData = function (url,arg) {
    let obj = "";
    $.ajax({
        type:"PUT",
        async:false,
        url:url+arg,
        success:function (response) {
            obj = response;
        },
        error: function (data) {
            console.info("error: " + data.responseText);
        }
    });
    return obj;
};


/**
 * 自定义封装的ajax delete请求
 * @param type
 * @param url
 * @param arg
 * @returns {string}
 */
let deleteData = function (url,arg) {
    let obj = "";
    $.ajax({
        type:"DELETE",
        async:false,
        url:url+arg,
        success:function (response) {
            obj = response;
        },
        error: function (data) {
            console.info("error: " + data.responseText);
        }
    });
    return obj;
};